<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

</head>
<body>
    <div id="app">
        <div v-color="'red'">这是一个标题</div>
        <!-- v-rapper -->
         <div v-rapper="'尤雨溪 rapper'"></div>
    </div>

    <script src="./js/axios.js"></script>
    <script src="./js/vue@3.5.13.js"></script>
    <script>
        const { createApp, onMounted, ref } = Vue
        const app = createApp({
            
            setup(){
                
                return{}
            }
        })

        //全局注册
        app.directive( 'color' ,{  //自定义颜色指令
            //el 获取 dom 元素
            mounted(el, binding){
                el.style.color = binding.value
                el.style.fontWeight = 'bolder'

            }
        })
        app.directive('rapper', {  //自定义rapper指令
            mounted(el,binding){
                el.innerText = binding.value
            }
        })

        app.mount("#app")  //挂载容器（最后）
    </script>
</body>
</html>